1. Field of the Invention
The present disclosure relates to an image processing method and an image processing device.
2. Description of the Related Art
A color filter array (CFA) in a Complementary Metal-Oxide-Semiconductor (CMOS) sensor is usually arranged in Bayer pattern. Raw data from a sensor is processed by de-mosaic processing (color interpolation) to produce an image, wherein each pixel of the image includes red, green and blue components. For example, a Bayer pattern is formed by one red pixel, one blue pixel and two green pixels (Gb and Gr) arranged in a 2*2 pixel array. The green pixel Gb is a green pixel arranged in a row with the blue pixels, and the green pixel Gr is a green pixel arranged in a row with the red pixels. The light amplitude of the green pixels Gb and Gr may be different due to layout or manufacturing differences, even with identical incident lights. Thus, a so-called false texture or maze artifact may occur after the de-mosaic processing.
A typical image processing device has a Gb/Gr imbalance correction unit to correct the differences of the green pixels. Referring to an exemplary Bayer pattern in FIG. 1, a conventional Gb/Gr imbalance correction method can be expressed as the following formula:Gr_avg=(G0+G1+G5+G6)/4Gb_avg=(2*G3+G2+G4)/4G_diff=Gr_avg−Gb_avgG3_bal=G3+G_diff
Take the green pixel g3 which is arranged in a row with the blue pixels as an example. The Gr_avg is an average of the green pixels in two rows with the red pixels, and the Gb_avg is an average of the green pixels in one row with the blue pixels. G_diff is a difference between Gr_avg and Gb_avg. The compensation value G3_bal of the green pixel g3 is equal to an original value G3 of the green pixel g3 plus the difference between the Gr_avg and Gb_avg. The method keeps the Gr values of the green pixels unchanged (namely, keeps the values of the green pixels in the row with the red pixels unchanged), but adjusts the Gb values of the green pixels.
However, the conventional Gr/Gb imbalance correction method will cause the edge to blur. In fact, the false texture or maze artifact is only obvious on the smooth region of an image, which is masked by the edge transition around the edge of the image. Therefore, a new Gr/Gb imbalance correction method which is able to suppress the false texture or maze artifact, and blurred-edges is called for.